package Eyjafjalla.effect;

import Eyjafjalla.card.attack.Volcano_Eyjafjalla;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.vfx.AbstractGameEffect;

public class FireStanceEffect extends AbstractGameEffect {
    public FireStanceEffect(float startX,float startY,float targetX,float targetY){
        c.current_x = startX;
        c.current_y = startY;
        c.drawScale = 1F;
        this.startingDuration = duration = 1.2F;
        xSpeed = (targetX - startX)/duration;
        ySpeed = (targetY - startY)/duration;
    }

    float xSpeed;
    float ySpeed;

    @Override
    public void update() {
        if(duration==startingDuration){
            AbstractDungeon.effectsQueue.add(new MarkFireBreathEffect(c,1.2F));
        }
        float delta = Gdx.graphics.getDeltaTime();
        c.current_x += delta*xSpeed;
        c.current_y += delta*ySpeed;
        this.duration -= delta;
        if (this.duration < 0.0F) {
            this.isDone = true;
        }
    }

    @Override
    public void render(SpriteBatch sb) {
        //no render card
    }

    @Override
    public void dispose() {

    }

    AbstractCard c = new Volcano_Eyjafjalla();
}
